using System;
using System.Data;
using System.Linq;
using System.ComponentModel;
using System.Reflection;
using System.Collections.Generic;
using DataObject.Database;
using DataObject.Model;

public partial class GuestMapper
{
    #region ToEntity

    public static Guest ToEntity(Guest entity, GuestDTO businessobject)
    {
        if (businessobject == null)
        {
            return null;
        }
        entity.Active = businessobject.Active;
        entity.AddressLine1 = businessobject.AddressLine1;
        entity.AddressLine2 = businessobject.AddressLine2;
        entity.City = businessobject.City;
        entity.CompanyName = businessobject.CompanyName;
        entity.CountryID = businessobject.CountryID;
        entity.Email = businessobject.Email;
        entity.Fax = businessobject.Fax;
        entity.FirstName = businessobject.FirstName;
        entity.GuestID = businessobject.GuestID;
        entity.GuestType = businessobject.GuestType;
        entity.Lastname = businessobject.Lastname;
        entity.Note = businessobject.Note;
        entity.Tel = businessobject.Tel;
        entity.Title = businessobject.Title;
        entity.UserId = businessobject.UserId;
        entity.Website = businessobject.Website;
        entity.ZipCode = businessobject.ZipCode;
        return entity;
    }

    #endregion

    #region ToBusinessObject

    public static GuestDTO ToBusinessObject(Guest entity)
    {
        if (entity == null)
        {
            return null;
        }
        return new GuestDTO
        {
            Active = entity.Active,
            AddressLine1 = entity.AddressLine1,
            AddressLine2 = entity.AddressLine2,
            City = entity.City,
            CompanyName = entity.CompanyName,
            CountryID = entity.CountryID,
            Email = entity.Email,
            Fax = entity.Fax,
            FirstName = entity.FirstName,
            GuestID = entity.GuestID,
            GuestType = entity.GuestType,
            Lastname = entity.Lastname,
            Note = entity.Note,
            Tel = entity.Tel,
            Title = entity.Title,
            UserId = entity.UserId,
            Website = entity.Website,
            ZipCode = entity.ZipCode
        };
    }

    #endregion

    #region ToBusinessObjectHasChildren

    public static GuestDTO ToBusinessObjectHasChildren(Guest entity, params Type[] types)
    {
        if (entity == null)
        {
            return null;
        }
        GuestDTO businessobject = new GuestDTO
        {
            Active = entity.Active,
            AddressLine1 = entity.AddressLine1,
            AddressLine2 = entity.AddressLine2,
            City = entity.City,
            CompanyName = entity.CompanyName,
            CountryID = entity.CountryID,
            Email = entity.Email,
            Fax = entity.Fax,
            FirstName = entity.FirstName,
            GuestID = entity.GuestID,
            GuestType = entity.GuestType,
            Lastname = entity.Lastname,
            Note = entity.Note,
            Tel = entity.Tel,
            Title = entity.Title,
            UserId = entity.UserId,
            Website = entity.Website,
            ZipCode = entity.ZipCode
        };
        return businessobject;
    }

    #endregion

}